Default sortMethod (plus: initialState from extra props)#718
Merged
Conversation
Member
|
Ahh shoot -- didn't mean to make conflicts here. |
Contributor
Author
It's fine, I knew it was coming. |
Contributor
Author
|
(Conflicts have been resolved.) |
| }) | ||
|
|
||
| .add('with custom default sort', () => { | ||
| return ( |
Member
There was a problem hiding this comment.
Should this have the sortProperties set like the previous story?
const sortProperties = [
{ id: 'name', sortAscending: true }
];
...
<Griddle
...
sortProperties={sortProperties}
sortMethod={sortBySecondCharacter}>
Contributor
Author
There was a problem hiding this comment.
I don't think this grid needs to be pre-sorted, no. This test is derived from the test that follows.
Member
There was a problem hiding this comment.
Got it - sorry about my confusion. 👍
Member
|
This looks great! I've run this locally on some of my projects also and everything seems to work well. I just have the one question on the story but it looks good to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Griddle major version
1.x
Changes proposed in this pull request
RowRenderPropertiesandColumnRenderProperties, which currently the same asRowDefinitionPropsandColumnDefinitionProps.initialStateis initialized to accept/overrideinitialStatefrom extraGriddleprops. Everything still seems to work as expected, but please double-check this.enableSettingsandtextPropertieswithout a plugin, as demonstrated with new stories.sortMethodfrom state is used, if it exists.textPropertiesWhy these changes are made
<Griddle sortMethod={...}>now works as a high-level hook to override all columns' sort behavior. It does not change default behavior (cc #466).Are there tests?
Stories!